<!DOCTYPE html>
<html lang="zh-CN">
{% load static %}
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>系统登录</title>
    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
    <style>
        body {
            overflow: hidden;
            background-color: #f8f9fa;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .login-container {
            width: 100%;
            max-width: 400px;
            padding: 20px;
            background: white;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0,0,0,0.1);
        }
        .logo {
            width: 120px;
            height: auto;
            margin: 0 auto 20px;
            display: block;
        }
    </style>
</head>
<body>
    <div id="app" class="login-container">
        <img src="{% static 'images/logo.png' %}" alt="Logo" class="logo">
        <h2 class="text-center mb-4">用户登录</h2>
        
        <form @submit.prevent="login">
            <div class="mb-3">
                <label for="username" class="form-label">用户名</label>
                <input type="text" class="form-control" id="username" v-model="formData.username" required>
            </div>
            <div class="mb-3">
                <label for="password" class="form-label">密码</label>
                <input type="password" class="form-control" id="password" v-model="formData.pwd" required>
            </div>
            <button type="submit" class="btn btn-primary w-100">登录</button>
        </form>
    </div>

    <script src="{% static 'js/vue.global.js' %}"></script>
    <script>
        const { createApp, ref } = Vue;
        
        createApp({
            setup() {
                const formData = ref({
                    username: '',
                    pwd: ''
                });
                
                const login = () => {
                    // 模拟登录数据
                    const mockUser = {
                        username: 'admin',
                        pwd: '123456'
                    };
                    
                    if(formData.value.username === mockUser.username && 
                       formData.value.pwd === mockUser.pwd) {
                        alert('登录成功');
                    } else {
                        alert('用户名或密码错误');
                    }
                };
                
                return {
                    formData,
                    login
                };
            }
        }).mount('#app');
    </script>
</body>
</html>